package top.lshaci.learning.springboot.jpa.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import top.lshaci.learning.springboot.jpa.entity.InterceptorEntity;

import java.util.List;

/**
 * InterceptorEntityRepository
 *
 * @author lshaci
 * @since 1.0.0
 */
public interface InterceptorEntityRepository extends JpaRepository<InterceptorEntity, Long> {

    @Query(value = "select * from interceptor_entity where id = ?1", nativeQuery = true)
    InterceptorEntity getById(Long id);

    @Query(value = "select * from interceptor_entity", nativeQuery = true)
    List<InterceptorEntity> getAll();
}
